<template>
  <div>
    <el-dialog
      v-dialogDrag
      ref="dialog"
      :close-on-click-modal="false"
      :visible.sync="openDetail"
      :before-close="cancel"
      :append-to-body="true"
      title="活动维护详情"
      width="70%"
      @open="init"
    >
      <el-form ref="DetailForm" :model="basicInfo" size="mini" label-width="90px">
        <el-row :gutter="6">
          <el-col :xs="24" :sm="8" :md="8">
            <el-form-item label="活动页主题" prop="ACTIVITY_PAGE_THEME">
              <el-input v-model="basicInfo.ACTIVITY_PAGE_THEME" size="mini" disabled/>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="8" :md="8">
            <el-form-item label="评论人" prop="REVIEWER">
              <el-input v-model="basicInfo.REVIEWER" size="mini" disabled/>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="8" :md="8">
            <el-form-item label="评论时间" prop="COMMENTS_TIME">
              <el-date-picker v-model="basicInfo.COMMENTS_TIME" value-format="yyyy-MM-dd" type="date" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="6">
          <el-col :xs="24" :sm="8" :md="8">
            <el-form-item label="是否精彩评论" prop="SELECTED_COMMENTS">
              <r-select v-model="basicInfo.SELECTED_COMMENTS" type="1004" disabled/>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="8" :md="8">
            <el-form-item label="是否已回复" prop="HAVE_RESPOND">
              <r-select v-model="basicInfo.HAVE_RESPOND" type="1004" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="6">
          <el-col :xs="24" :sm="8" :md="24">
            <el-form-item label="评论内容" prop="COMMENTS">
              <el-input v-model="basicInfo.COMMENTS" type="textarea" size="small " disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="6">
          <el-col :xs="24" :sm="8" :md="24">
            <el-form-item label="回复内容" prop="RESPOND">
              <el-input v-model="basicInfo.RESPOND" type="textarea" size="small " disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <div slot="footer" class="dialog-footer" style="text-align:center;">
        <el-button type="text">
          <i class="el-icon-search magnifier" />
        </el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import BaseTable from '@/components/BaseTable'
import formMixins from '@/mixins/formMixins'
import rSelect from '@/components/Select/Select'
import filtercode from '@/components/Checkbox/filtercode'

export default {
  name: 'ACTMSGDETAIL',
  components: {
    rSelect,
    BaseTable,
    filtercode
  },
  mixins: [formMixins],
  props: {
    openDetail: {
      type: Boolean,
      default: false
    },
    msgInfo: {
      type: Object,
      // eslint-disable-next-line vue/require-valid-default-prop
      default: {}
    }
  },
  data() {
    return {
      basicInfo: {
        ACTIVITY_PAGE_THEME: '',
        REVIEWER: '',
        COMMENTS_TIME: '',
        SELECTED_COMMENTS: '',
        HAVE_RESPOND: '',
        COMMENTS: '',
        RESPOND: ''
      }
    }
  },
  mounted() {
  },
  methods: {
    init() {
      console.log(this.msgInfo)
      this.basicInfo = {
        ACTIVITY_PAGE_THEME: this.msgInfo.ACTIVITY_PAGE_THEME,
        REVIEWER: this.msgInfo.REVIEWER,
        COMMENTS_TIME: this.msgInfo.COMMENTS_TIME,
        SELECTED_COMMENTS: this.msgInfo.SELECTED_COMMENTS,
        HAVE_RESPOND: this.msgInfo.HAVE_RESPOND,
        COMMENTS: this.msgInfo.COMMENTS,
        RESPOND: this.msgInfo.RESPOND
      }
    },

    cancel() {
      this.basicInfo = {
        ACTIVITY_PAGE_THEME: '',
        REVIEWER: '',
        COMMENTS_TIME: '',
        SELECTED_COMMENTS: '',
        HAVE_RESPOND: '',
        COMMENTS: '',
        RESPOND: ''
      }
      this.$emit('update:openDetail', false)
    }

  }
}
</script>

<style scoped>
</style>
